<template>
  <div>
    <div class="box">
      <span class="classday">当前生产日：{{ itemDetials.classDay }}</span>
      <div class="centeritem">
        <dv-decoration-7
          style="width: 150px; height: 30px; font-size: 18px; color: wheat"
          >当班生产数量</dv-decoration-7
        >
        <h1>{{ tdyData1 }}</h1>
      </div>
      <div class="centeritem">
        <dv-decoration-7
          style="width: 150px; height: 30px; font-size: 18px; color: wheat"
          >今日生产数量</dv-decoration-7
        >
        <h1>{{ tdyData1 + tdyData }}</h1>
      </div>
      <div class="rightitem">
        <div class="titext">
          <p style="font-size: 22px; color: aliceblue">本日</p>
          <div v-for="(item, index) in itemMsg4" :key="index">
            <p>{{ item.className }}：{{ item.classCount }}</p>
          </div>

          <!-- <p>B班：0</p> -->
        </div>
        <div class="bitext">
          <p style="font-size: 22px; color: aliceblue">本月</p>
          <div v-for="(item, index) in itemMsg4" :key="index">
            <p>{{ item.className }}：{{ item.classCount + 6600 }}</p>
          </div>
        </div>
      </div>
    </div>
    <dv-decoration-10
      style="width: 750px; height: 5px; margin: -40px 0 0 30px"
    />
  </div>
</template>

<script>
export default {
  props: {
    itemDetials: {
      type: Object,
      default: () => ({}),
    },
    itemMsg4: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return { tdyData: "", tdyData1: "" };
  },
  methods: {
    getValue() {
      if (this.itemMsg4.length > 0) {
        this.tdyData = this.itemMsg4[0].classCount;
        this.tdyData1 = this.itemMsg4[1].classCount;
      }
    },
  },
  created() {
    this.getValue();
  },
};
</script>

<style lang="scss" scoped>
.classday {
  position: absolute;
}
.box {
  display: flex;
  width: 850px;
  height: 340px;
  padding: 0 30px 30px 30px;
  color: #8993f2;
  .leftitem,
  .centeritem {
    width: 38%;
    height: 60%;
    margin-top: 10%;
    display: flex;
    flex-direction: column;
    align-items: center;
    h1 {
      font-weight: 700;
      color: dodgerblue;
      margin-top: 100px;
    }
  }
  .rightitem {
    font-size: 18px;
    color: #8fa7e5;
    width: 20%;
    height: 100%;
    display: flex;
    flex-direction: column;
    .titext,
    .bitext {
      height: 50%;
    }
  }
}
</style>
